#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
using namespace std;
class Solution {
public:
    int removeDuplicates(vector<int>& nums)
    {
        set<int> ret;
        for (int i = 0; i < nums.size(); i++)
        {
            ret.insert(nums[i]);
        }
        vector<int> v;
        int i = 0;
        auto it = ret.begin();
        while (it != ret.end())
        {
            v.push_back(*it);
            it++;
        }
        sort(v.begin(), v.end());
        swap(v, nums);
        return nums.size();
    }
};